]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensions-app: Validate .desktop file during meson test
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 1 Apr 2020 04:18:05 +0000 (06:18 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Sun, 5 Apr 2020 11:02:00 +0000 (11:02 +0000)
... if desktop-file-validate is available.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1160

subprojects/extensions-app/data/meson.build
subprojects/extensions-app/meson.build

index 0568fafc81c7f25354c5ed31e6fe85fafefeb2a1..e7bfa9965afd8e3115fd3c5ac7709e07f0b614cb 100644 (file)
@@ -6,6 +6,7 @@ gnome.compile_resources(
   install_dir: pkgdatadir
 )
 
+desktop_file = app_id + '.desktop'
 desktopconf = configuration_data()
 # We substitute in bindir so it works as an autostart
 # file when built in a non-system prefix
@@ -15,17 +16,25 @@ desktopconf.set('prgname', prgname)
 
 i18n.merge_file('desktop',
   input: configure_file(
-    input: app_id + '.desktop.in.in',
-    output: app_id + '.desktop.in',
+    input: desktop_file + '.in.in',
+    output: desktop_file + '.in',
     configuration: desktopconf
   ),
-  output: app_id + '.desktop',
+  output: desktop_file,
   po_dir: po_dir,
   install: true,
   install_dir: desktopdir,
   type: 'desktop'
 )
 
+if (desktop_file_validate.found())
+  test('Validating ' + desktop_file,
+    desktop_file_validate,
+    args: [desktop_file],
+    workdir: meson.current_build_dir()
+  )
+endif
+
 configure_file(
   input: app_id + '.service.in',
   output: app_id + '.service',
index e26b5b20daed665122b3cf15b3a416b769153c4a..2c1c5de6e266b566bf2ea3fac1814b0f653700da 100644 (file)
@@ -37,6 +37,7 @@ servicedir = join_paths(datadir, 'dbus-1', 'services')
 
 gjs = find_program('gjs')
 appstream_util = find_program('appstream-util', required: false)
+desktop_file_validate = find_program('desktop-file-validate', required: false)
 
 subdir('data')
 subdir('js')